package Day14;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo01 {
    public static void main(String[] args) {
        //Map
        //HashMap/Hashtable/ConcurrentHashMap
        //TreeMap
        //LinkedHashMap
        HashMap<String,String> data = new HashMap<>();
        data.put("key1","锄禾日当午");
        data.put("key2","汗滴禾下土");
        String value = data.get("key1");
        System.out.println(value);
//        Set<Map.Entry<String, String>> set = data.entrySet();
        Set<String> set = data.keySet();
        for (String key:set) {
//            System.out.println(key);
//            //key1
//            //key2
            System.out.println(key + "->" + data.get(key));
            //key1->锄禾日当午
            //key2->汗滴禾下土
        }

        Collection<String> values = data.values();
        for (String xxx:values) {
            System.out.println(xxx);
            //锄禾日当午
            //汗滴禾下土
        }
    }
}
